-- background: 3235 from stack: in.1ะตะตะต -- bmap block id: 9132 -- flags: 4000 -- background id: 0 -- name: ----- HyperTalk script ----- On openBackground end openBackground On giveResults global oppAim global oppLanceFlag global yourLanceFlag global yourLances global oppLances global oppMissFlag global yourMissFlag global youThud global compThud global attacker global oppHitBarrier global youHitBarrier global oppHitHorse global youHitHorse global aFlag global hitYourCrest global hitOppCrest global yourThudScore global oppThudScore global oppCrestScore global yourCrestScore global oppGoneFlag global youGoneFlag global x global oppGoesThud global youGoThud global oldOppLances global oldYourLances global oppLanceWin global youLanceWin global winLose global check global oppcheck global youBrokeScore global oppBrokeScore -- Where opponent is aiming If oppAim =1 then put "Crest of Helm" into line two of field 1 If oppAim =2 then put "Helm" into line two of field 1 If oppAim =3 then put "Throat Gorget" into line two of field 1 If oppAim =4 then put "Dexter Chief" into line two of field 1 If oppAim =5 then put "Chief Pale" into line two of field 1 If oppAim =6 then put "Sinister Chief" into line two of field 1 If oppAim =7 then put "Dexter Fess" into line two of field 1 If oppAim =8 then put "Fess Pale" into line two of field 1 If oppAim =9 then put "Sinister Fess" into line two of field 1 If oppAim =10 then put "Shield Base" into line two of field 1 -- Opponent breaks lance if oppLanceFlag=1 then put "He Broke Lance!" into line three of field 1 put 0 into oppLanceFlag end if -- You break lance if yourLanceFlag=1 then put "You Broke Lance!" into line five of field 1 put 0 into yourLanceFlag end if -- Opponent Misses If oppMissFlag=1 then put "He Missed!" into line three of field 1 put 0 into oppMissFlag end if -- You Miss If yourMissFlag=1 then put "You Missed!" into line five of field 1 put 0 into yourMissflag end if -- Unhorsing If youThud = 1 then put "He Unhorsed You!" into line 4 of field 1 put 0 into youThud add 1 to oppThudScore put "Opponents Unhorsed: "&oppThudScore into line 2 of field 2 put 1 into youGoThud put 1 into winLose end if If compThud = 1 then put "You Unhorsed Him!" into line 6 of field 1 put 0 into compThud add 1 to yourThudScore put "Opponents Unhorsed: "&yourThudScore into line 2 of field 3 put 1 into oppGoesThud put 1 into winLose end if -- Foul If oppHitBarrier = 1 then put "FOUL! Opponent Hits Wall" into line 4 of field 1 put 0 into oppHitBarrier put oppLances - 1 into oppLances end if If oppHitHorse = 1 then put "FOUL! Opponent Hits Horse!" into line 4 of field 1 put 0 into oppHitHorse put 1 into oppGoneFlag put 1 into winLose end if If youHitBarrier = 1 then put "FOUL! You Hit Wall" into line 6 of field 1 put 0 into youHitBarrier put yourLances - 1 into yourLances end if If youHitHorse = 1 then put "FOUL! You Hit Horse!" into line 6 of field 1 put 0 into youHitHorse put 1 into youGoneFlag put 1 into winLose end if -- Crests If hitYourCrest = 1 then put "HE TORE YOUR CREST!!!" into line 4 of field 1 add 1 to oppCrestScore put 0 into hitYourCrest end if If hitOppCrest = 1 then put "YOU TORE HIS CREST!!" into line 6 of field 1 add 1 to yourCrestScore put 0 into hitOppCrest end if set the lockScreen to true put "Crests Claimed: "&oppCrestScore into line 1 of field 2 put "Crests Claimed: "&yourCrestScore into line 1 of field 3 put "Opponents Unhorsed: "&yourThudScore into line 2 of field 3 put "Opponents Unhorsed: "&oppThudScore into line 2 of field 2 put "Lances Broken: "&oppBrokeScore into line 3 of field 2 put "Lances Broken: "&youBrokeScore into line 3 of field 3 put "Lances Total: "&yourLances into line 4 of field 3 put "Lances Total: "&oppLances into line 4 of field 2 if oppBrokeScore = 3 then put 1 into oppLanceWin if youBrokeScore = 3 then put 1 into youLanceWin End giveResults On lanceHit global aFlag global eFlag global attacker global oppLances global YourLances global oppLanceFlag global yourLanceFlag global oppLanceWin global youLanceWin global check global oppCheck global youBrokeScore global oppBrokeScore global winlose If eFlag =1 then maybeFall If attacker = 1 then put 1 into oppLanceFlag add 1 to oppLances add 1 to oppcheck add 1 to oppBrokeScore if oppcheck = 3 then put 1 into winLose put 0 into oppcheck put 0 into check end if end if if attacker = 2 then put 1 into yourLanceFlag add 1 to yourLances add 1 to check add 1 to youBrokeScore if check = 3 then put 1 into winLose put 0 into check put 0 into oppcheck end if end if put 0 into eFlag If aFlag = 1 then maybeCrest End lanceHit On miss global dFlag global attacker global oppMissFlag global yourMissFlag if attacker = 1 then put 1 into oppMissFlag if attacker = 2 then put 1 into yourMissFlag if dFlag = 1 then maybefoul end Miss On dice global roll Put the random of 20 into roll End dice on maybeFall dice global eFlag global roll global compThud global youThud global attacker global yourLanceFlag global oppLanceFlag If (eFlag = 1) and (attacker = 1) then if roll <=6 then put 1 into youThud end if If (eFlag = 1) and (attacker = 2) then if roll <=6 then put 1 into compThud end if put 0 into eFlag end maybeFall on maybeFoul global dFlag global roll global attacker global oppHitBarrier global youHitBarrier global oppHitHorse global youHitHorse put 0 into dFlag dice If attacker = 1 and roll <=5 then put 1 into oppHitBarrier end if if attacker = 1 and roll >5 and roll <9 then put 1 into oppHitHorse end if If attacker = 2 and roll <=5 then put 1 into youHitBarrier end if if attacker = 2 and roll >6 and roll <9 then put 1 into youHitHorse end if end maybeFoul On maybeCrest global aFlag global hitYourCrest global hitOppCrest global attacker global roll put 0 into aFlag dice If attacker = 1 and roll <6 then put 1 into hitYourCrest If attacker = 2 and roll <6 then put 1 into hitOppCrest end maybeCrest --****************************************** On lrCRT global attacker global CRTdefense global CRToffense global defense global oppDefense global aimPoint global eFlag global dFlag global roll global tempCompScore global tempYouScore global tempCompMiss global tempYouMiss global oppAim put 0 into dFlag put 0 into eFlag If attacker = 1 then put defense-20 into CRTdefense put oppAim into CRToffense end if If attacker = 2 then put oppDefense into CRTdefense put aimPoint-1 into CRToffense end if If CRToffense = 1 then dice if roll >= 19 then lanceHit else miss end if If CRToffense = 2 then dice put 1 into dFlag if roll >= 18 then lanceHit else miss put 0 into dFlag end if If CRToffense = 3 then dice put 1 into dFlag if roll >= 17 then lanceHit else miss put 0 into dFlag end if If CRToffense = 4 then dice if roll >= 6 then lanceHit else miss end if If CRToffense = 5 then dice if roll >= 11 then lanceHit else miss end if If CRToffense = 6 then dice put 1 into dFlag if roll >= 19 then lanceHit else miss put 0 into dFlag end if If CRToffense = 7 then dice put 1 into eFlag if roll >= 9 then lanceHit else miss put 0 into eFlag end if If CRToffense = 8 then dice if roll >= 11 then lanceHit else miss end if If CRToffense = 9 then dice put 1 into dFlag if roll >= 17 then lanceHit else miss put 0 into dFlag end if If CRToffense = 10 then dice put 1 into dFlag if roll >= 13 then lanceHit else miss put 0 into dFlag end if End lrCRT --********************************************** --********************************************** On llCRT global attacker global CRTdefense global CRToffense global defense global oppDefense global aimPoint global eFlag global dFlag global roll global tempCompScore global tempYouScore global tempCompMiss global tempYouMiss global oppAim put 0 into dFlag put 0 into eFlag If attacker = 1 then put defense-20 into CRTdefense put oppAim into CRToffense end if If attacker = 2 then put oppDefense into CRTdefense put aimPoint-1 into CRToffense end if If CRToffense = 1 then dice if roll >= 15 then lanceHit else miss end if If CRToffense = 2 then dice put 1 into eFlag if roll >= 13 then lanceHit else miss put 0 into eFlag end if If CRToffense = 3 then dice if roll >= 13 then lanceHit else miss end if If CRToffense = 4 then dice put 1 into dFlag if roll >= 17 then lanceHit else miss put 0 into dFlag end if If CRToffense = 5 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 6 then dice if roll >= 7 then lanceHit else miss end if If CRToffense = 7 then dice put 1 into dFlag if roll >= 15 then lanceHit else miss put 0 into dFlag end if If CRToffense = 8 then dice if roll >= 6 then lanceHit else miss end if If CRToffense = 9 then dice put 1 into eFlag if roll >= 8 then lanceHit else miss put 0 into eFlag end if If CRToffense = 10 then dice put 1 into eFlag if roll >= 4 then lanceHit else miss put 0 into eFlag end if End llCRT --********************************************** --********************************************** On ssCRT global attacker global CRTdefense global CRToffense global defense global oppDefense global aimPoint global aFlag global eFlag global dFlag global roll global tempCompScore global tempYouScore global tempCompMiss global tempYouMiss global oppAim put 0 into aFlag put 0 into dFlag put 0 into eFlag If attacker = 1 then put defense-20 into CRTdefense put oppAim into CRToffense end if If attacker = 2 then put oppDefense into CRTdefense put aimPoint-1 into CRToffense end if If CRToffense = 1 then dice put 1 into aFlag if roll >= 13 then lanceHit else miss put 0 into aFlag end if If CRToffense = 2 then dice put 1 into eFlag if roll >= 11 then lanceHit else miss put 0 into eFlag end if If CRToffense = 3 then dice if roll >= 11 then lanceHit else miss end if If CRToffense = 4 then dice if roll >= 6 then lanceHit else miss end if If CRToffense = 5 then dice put 1 into eFlag if roll >= 6 then lanceHit else miss put 0 into eFlag end if If CRToffense = 6 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 7 then dice if roll >= 5 then lanceHit else miss end if If CRToffense = 8 then dice put 1 into eFlag if roll >= 3 then lanceHit else miss put 0 into eFlag end if If CRToffense = 9 then dice put 1 into eFlag if roll >= 11 then lanceHit else miss put 0 into eFlag end if If CRToffense = 10 then dice if roll >= 6 then lanceHit else miss end if End ssCRT --********************************************** --********************************************** On shCRT global attacker global CRTdefense global CRToffense global defense global oppDefense global aimPoint global eFlag global dFlag global roll global tempCompScore global tempYouScore global tempCompMiss global tempYouMiss global oppAim put 0 into dFlag put 0 into eFlag If attacker = 1 then put defense-20 into CRTdefense put oppAim into CRToffense end if If attacker = 2 then put oppDefense into CRTdefense put aimPoint-1 into CRToffense end if If CRToffense = 1 then dice if roll >= 17 then lanceHit else miss end if If CRToffense = 2 then dice if roll >= 15 then lanceHit else miss end if If CRToffense = 3 then dice if roll >= 17 then lanceHit else miss end if If CRToffense = 4 then dice if roll >= 6 then lanceHit else miss end if If CRToffense = 5 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 6 then dice if roll >= 13 then lanceHit else miss end if If CRToffense = 7 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 8 then dice if roll >= 6 then lanceHit else miss end if If CRToffense = 9 then dice if roll >= 11 then lanceHit else miss end if If CRToffense = 10 then dice put 1 into eFlag if roll >= 3 then lanceHit else miss put 0 into eFlag end if End shCRT --********************************************** --********************************************** On slCRT global attacker global CRTdefense global CRToffense global defense global oppDefense global aimPoint global aFlag global eFlag global dFlag global roll global tempCompScore global tempYouScore global tempCompMiss global tempYouMiss global oppAim put 0 into aFlag put 0 into dFlag put 0 into eFlag If attacker = 1 then put defense-20 into CRTdefense put oppAim into CRToffense end if If attacker = 2 then put oppDefense into CRTdefense put aimPoint-1 into CRToffense end if If CRToffense = 1 then dice put 1 into aFlag if roll >= 11 then lanceHit else miss put 0 into aFlag end if If CRToffense = 2 then dice put 1 into eFlag if roll >= 13 then lanceHit else miss put 0 into eFlag end if If CRToffense = 3 then dice put 1 into eFlag if roll >= 15 then lanceHit else miss put 0 into eFlag end if If CRToffense = 4 then dice if roll >= 15 then lanceHit else miss end if If CRToffense = 5 then dice put 1 into eFlag if roll >= 6 then lanceHit else miss put 0 into eFlag end if If CRToffense = 6 then dice if roll >= 11 then lanceHit else miss end if If CRToffense = 7 then dice if roll >= 5 then lanceHit else miss end if If CRToffense = 8 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 9 then dice if roll >= 13 then lanceHit else miss end if If CRToffense = 10 then dice if roll >= 11 then lanceHit else miss end if End slCRT --********************************************** --********************************************** On lhCRT global attacker global CRTdefense global CRToffense global defense global oppDefense global aimPoint global eFlag global dFlag global roll global tempCompScore global tempYouScore global tempCompMiss global tempYouMiss global oppAim put 0 into dFlag put 0 into eFlag If attacker = 1 then put defense-20 into CRTdefense put oppAim into CRToffense end if If attacker = 2 then put oppDefense into CRTdefense put aimPoint-1 into CRToffense end if If CRToffense = 1 then dice if roll >= 19 then lanceHit else miss end if If CRToffense = 2 then dice if roll >= 16 then lanceHit else miss end if If CRToffense = 3 then dice if roll >= 16 then lanceHit else miss end if If CRToffense = 4 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 5 then dice put 1 into eFlag if roll >= 6 then lanceHit else miss put 0 into eFlag end if If CRToffense = 6 then dice if roll >= 13 then lanceHit else miss end if If CRToffense = 7 then dice if roll >= 9 then lanceHit else miss end if If CRToffense = 8 then dice if roll >= 5 then lanceHit else miss end if If CRToffense = 9 then dice if roll >= 11 then lanceHit else miss end if If CRToffense = 10 then dice if roll >= 11 then lanceHit else miss end if End lhCRT --********************************************** -- part 2 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=275 top=130 right=239 bottom=501 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: ResultBox -- part 3 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=4 top=265 right=338 bottom=235 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: OwnHonorsBox -- part 4 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=247 top=265 right=338 bottom=499 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: OppHonorsBox -- part 6 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=275 top=130 right=151 bottom=502 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 5 -- text size: 14 -- style flags: 0 -- line height: 18 -- part name: -- part 8 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=271 top=23 right=49 bottom=374 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: New Button ----- HyperTalk script ----- on mouseUp global turn if turn > 0 then set the lockScreen to true put " " into line 2 of field 1 put " " into line 3 of field 1 put " " into line 4 of field 1 put " " into line 5 of field 1 put " " into line 6 of field 1 put "Crests Claimed: " into line 1 of field 2 put "Crests Claimed: " into line 1 of field 3 put "Opponents Unhorsed: " into line 2 of field 2 put "Opponents Unhorsed: " into line 2 of field 3 put "Lances Broken: " into line 3 of field 2 put "Lances Broken: " into line 3 of field 3 put "Lances Total: " into line 4 of field 3 put "Lances Total: " into line 4 of field 2 end if play "boing" global oppThudScore global turn global oppCrestScore global yourCrestScore global oppGoneFlag global youGoneFlag global youGoThud global oppGoesThud global oppLanceWin global youLanceWin global winLose If winLose = 1 then go Card 10 If winLose = 0 then go to card 2 end mouseUp